package export.monster
{
	import base.BaseMonster;
	
	import com.game.manager.AnimationManager;
	
	import export.bullet.FollowTargetBullet;
	
	import flash.geom.Rectangle;
	//蝙蝠洞窟小蝙蝠
	public class Monster201 extends BaseMonster
	{
		public function Monster201()
		{
			super();
			isFly = true;
			setLostGravity();
		}
		
		override protected function initAttribute():void
		{
			super.initAttribute();
			mavo.attackRange = 50;
		}
		
		override protected function initBBDC():void
		{
			bbdc = AnimationManager.getAnimation("Monster201Action");
			bbdc.setAction("idle");
			bbdc.turnRight();
			bbdc.addCallBack(onEnterFrame, onActionOver);
			bodyContainer.addChild(bbdc);
		}
		
		override protected function initCollideArea():void
		{
			collideBox = new Rectangle(-30,-30,60,60);
			super.initCollideArea();
		}
		
		override protected function onEnterFrame(action:String, frameCount:int):void
		{
			switch (action)
			{
				case "attack1":
					if(frameCount == 1)
					{
						var b:FollowTargetBullet = new FollowTargetBullet("Monster201Attack1");
						b.setOwner(this);
						b.setHurt(getActionHurt("attack1"));
						b.setAction("Monster201Attack1");
						gc.gameScene.addChild(b);
						magicBulletArray.push(b);
					}
			}
		}
	}
}